<div class="container" id="gio_hang">
	<div class="row">
		<h2 class="span12 text-center"> <%= t 'xem_gio_hang_cua_ban'%> </h2>
	</div>
	<div class="row">
		<div class="span12">
			<% if @gio_hang.da_xu_ly %>
			<span class="label label-success"><%= t 'da_xu_ly'%></span>
			<% else %>
			<span class="label label-warning"><%= t 'dang_cho'%></span>
			<% end %>
		</div>
	</div>
	<% if !@cho_phep_edit %>
	<div class="row">
		<table class="table table-stripped span12">
			<tr>
				<th><%= t 'ten_nguoi_dat_hang'%></th>
				<td><%= @gio_hang.nguoi_dung.ten_hien_thi%></td>
			</tr>
			<tr>
				<th><%= t 'thoi_gian_dat_hang'%></th>
				<td><%= @gio_hang.updated_at.strftime('%Y-%m-%d %H:%M:%S')%></td>
			</tr>
			<tr>
				<th><%= t 'dia_chi_nhan_hang'%></th>
				<td><%= @gio_hang.dia_chi_nhan_hang%></td>
			</tr>
			<tr>
				<th><%= t 'dien_thoai_lien_lac'%></th>
				<td><%= @gio_hang.dien_thoai_lien_lac%></td>
			</tr>
		</table>
	</div>
	<% end %>
	<%= form_tag request.url do %>
	<div class="row">
		<table class="table table-bordered gio_hang span12">
			<tr>
				<th colspan="2"><%= t'san_pham'%></th>
				<th><%= t'so_luong'%></th>
				<th><%= t'thanh_tien'%></th>
			</tr>
			<% for sp in @gio_hang.san_pham_muas %>
			<tr>
				<td class="sp_avatar"><img class="img-rounded" src="<%= sp.san_pham.hinh_anh %>"></td>
				<td class="sp_noi_dung"><h4><a href="<%= url_for :action=>'index', :controller=>'san_pham', :danh_muc_slug => sp.san_pham.danh_muc.slug, :san_pham_slug => sp.san_pham.slug %>"><%= sp.san_pham.noi_dung(@ngon_ngu, true).tieu_de%></a></h4>
				<p>
					<span><%= t'gia_mua'%></span><span> <strong><%= number_with_delimiter sp.gia_mua, :delimiter => " " %></span></strong><span class="tien_te">VND</span>
				</p></td>
				<td class="sp_so_luong"> <% if @cho_phep_edit %>
				<%= text_field_tag "san_pham[#{sp.id}][so_luong]", sp.so_luong %>
				<% else %>
				<%= sp.so_luong %>
				<% end %> </td>
				<td class="sp_thanh_tien"> <%= number_with_delimiter(sp.so_luong * sp.gia_mua, :delimiter => " ") %> </td>
			</tr>
			<% end %>
			<tr>
				<th colspan="3" class="text-right"><%= t'tong_tien'%></th>
				<td class="sp_tong_tien"><%= number_with_delimiter @gio_hang.tong_gia_tri, :delimiter => " "%> <span class="tien_te">VND</span></td>
			</tr>
		</table>
	</div>
	<% if @cho_phep_edit %>
	<div class="row">
		<div class="span12">
			<p>
				<%= label_tag :nguoi_dat_hang, t('ten_nguoi_dat_hang') %>
				<%= text_field_tag :nguoi_dat_hang, params[:nguoi_dat_hang] ? params[:nguoi_dat_hang] : @gio_hang.nguoi_dung.ten_hien_thi, :class=>"input-xlarge", :readonly => true %>
			</p>
			<p>
				<%= label_tag :dien_thoai_lien_lac, t('dien_thoai_lien_lac') %>
				<%= text_field_tag :dien_thoai_lien_lac, number_to_phone(@gio_hang.dien_thoai_lien_lac ? @gio_hang.dien_thoai_lien_lac : @gio_hang.nguoi_dung.so_dien_thoai), :class=>"input-xlarge" %>
			</p>
			<p>
				<%= label_tag :dia_chi_nhan_hang, t('dia_chi_nhan_hang') %>
				<%= text_field_tag :dia_chi_nhan_hang, @gio_hang.dia_chi_nhan_hang, :class=>"input-xxlarge" %>
			</p>
			<div>
				<div class="pull-left">
					<%= submit_tag t('cap_nhat'), :class=>"btn btn-primary" %>
					<%= submit_tag t('thanh_toan'), :class=>"btn btn-success", :name=> 'thanh_toan'%>
					<a href="<%= url_for :action=>'xoa'%>" class="btn btn-danger"><%= t 'lam_rong_gio_hang'%> <i class="icon-trash"></i></a>
					<a href="<%= redirect_url  %>" class="btn"><%= t 'tiep_tuc_mua_hang'%> <i class="icon-chevron-right"></i></a>
				</div>
				<div class="pull-right">

				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	<% end %>
	<% end %>
</div>
